package com.leezk.order.controller;


import com.leezk.order.constant.CommonConstant;
import com.leezk.order.dto.ResultDTO;
import com.leezk.order.utils.UploadUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author leotong
 */
@RestController
@RequestMapping(CommonConstant.API_URI_VERSION_V1+"/common")
public class CommonController {

    @PostMapping("/uploadFile")
    public ResultDTO<String> uploadFile(MultipartFile file) throws Exception {
        return ResultDTO.success(UploadUtil.uploadImg(file));
    }

}
